gboolean ret = FALSE;
GString *output = g_string_new ("");
g_autoptr(GOutputStream) out_stream = NULL;
- gs_unref_ptrarray GPtrArray *loader_configs = NULL;
+ g_autoptr(GPtrArray) loader_configs = NULL;
guint i;
gsize bytes_written;
gboolean is_efi;
if (ostree_sysroot_get_booted_deployment (self->sysroot) == NULL
&& g_file_has_parent (self->sysroot->path, NULL))
{
- gs_unref_ptrarray GPtrArray *deployments = NULL;
+ g_autoptr(GPtrArray) deployments = NULL;
OstreeDeployment *tool_deployment;
g_autoptr(GFile) tool_deployment_root = NULL;
GError **error)
{
gboolean ret = FALSE;
- gs_unref_ptrarray GPtrArray *boostree_loader_configs = NULL;
+ g_autoptr(GPtrArray) boostree_loader_configs = NULL;
guint i;
if (!_ostree_sysroot_read_boot_loader_configs (self->sysroot, bootversion, &boostree_loader_configs,
g_autoptr(GFile) new_config_path = NULL;
g_autofree char *config_contents = NULL;
g_autofree char *new_config_contents = NULL;
- gs_unref_ptrarray GPtrArray *new_lines = NULL;
- gs_unref_ptrarray GPtrArray *tmp_lines = NULL;
+ g_autoptr(GPtrArray) new_lines = NULL;
+ g_autoptr(GPtrArray) tmp_lines = NULL;
g_autofree char *kernel_arg = NULL;
gboolean saw_default = FALSE;
gboolean regenerate_default = FALSE;
GCancellable *cancellable,
GError **error)
{
- gs_unref_ptrarray GPtrArray *boot_loader_configs = NULL;
+ g_autoptr(GPtrArray) boot_loader_configs = NULL;
OstreeBootconfigParser *config;
const char *val;
g_autoptr(GFile) new_config_path = NULL;
g_autofree char *config_contents = NULL;
g_autofree char *new_config_contents = NULL;
- gs_unref_ptrarray GPtrArray *new_lines = NULL;
+ g_autoptr(GPtrArray) new_lines = NULL;
/* This should follow the symbolic link to the current bootversion. */
config_contents = gs_file_load_contents_utf8 (self->config_path, cancellable, error);
gsize header_size;
g_autoptr(GInputStream) ret_input = NULL;
gs_unref_variant GVariant *file_header = NULL;
- gs_unref_ptrarray GPtrArray *streams = NULL;
+ g_autoptr(GPtrArray) streams = NULL;
g_autoptr(GOutputStream) header_out_stream = NULL;
g_autoptr(GInputStream) header_in_stream = NULL;
OstreeContentSizeCacheEntry *e_size = NULL;
GVariantBuilder index_builder;
guint i;
- gs_unref_ptrarray GPtrArray *sorted_keys = NULL;
+ g_autoptr(GPtrArray) sorted_keys = NULL;
g_hash_table_iter_init (&entries, self->object_sizes);
g_variant_builder_init (&index_builder,
const char *hardlink;
const char *basename;
g_autoptr(GFileInfo) file_info = NULL;
- gs_unref_ptrarray GPtrArray *split_path = NULL;
- gs_unref_ptrarray GPtrArray *hardlink_split_path = NULL;
+ g_autoptr(GPtrArray) split_path = NULL;
+ g_autoptr(GPtrArray) hardlink_split_path = NULL;
glnx_unref_object OstreeMutableTree *subdir = NULL;
glnx_unref_object OstreeMutableTree *parent = NULL;
glnx_unref_object OstreeMutableTree *hardlink_source_parent = NULL;
goto out;
}
- { gs_unref_ptrarray GPtrArray *deltas = NULL;
+ { g_autoptr(GPtrArray) deltas = NULL;
guint i;
if (!ostree_repo_list_static_delta_names (self, &deltas,
GError **error)
{
gboolean ret = FALSE;
- gs_unref_ptrarray GPtrArray *ret_sizenames =
+ g_autoptr(GPtrArray) ret_sizenames =
g_ptr_array_new_with_free_func (_ostree_delta_content_sizenames_free);
g_autoptr(GHashTable) sizenames_map =
g_hash_table_new_full (g_str_hash, g_str_equal, NULL, _ostree_delta_content_sizenames_free);
gboolean ret = FALSE;
g_autoptr(GHashTable) ret_modified_regfile_content =
g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)g_ptr_array_unref);
- gs_unref_ptrarray GPtrArray *from_sizes = NULL;
- gs_unref_ptrarray GPtrArray *to_sizes = NULL;
+ g_autoptr(GPtrArray) from_sizes = NULL;
+ g_autoptr(GPtrArray) to_sizes = NULL;
guint i, j;
guint lower;
guint upper;
guint64 total_compressed_size = 0;
guint64 total_uncompressed_size = 0;
gs_unref_variant_builder GVariantBuilder *part_headers = NULL;
- gs_unref_ptrarray GPtrArray *part_tempfiles = NULL;
+ g_autoptr(GPtrArray) part_tempfiles = NULL;
gs_unref_variant GVariant *delta_descriptor = NULL;
gs_unref_variant GVariant *to_commit = NULL;
g_autofree char *descriptor_relpath = NULL;
GError **error)
{
gboolean ret = FALSE;
- gs_unref_ptrarray GPtrArray *ret_deltas = NULL;
+ g_autoptr(GPtrArray) ret_deltas = NULL;
g_autoptr(GFileEnumerator) dir_enum = NULL;
ret_deltas = g_ptr_array_new_with_free_func (g_free);
OstreeRollsumMatches *ret_rollsum = NULL;
g_autoptr(GHashTable) from_rollsum = NULL;
g_autoptr(GHashTable) to_rollsum = NULL;
- gs_unref_ptrarray GPtrArray *matches = NULL;
+ g_autoptr(GPtrArray) matches = NULL;
const guint8 *from_buf;
gsize from_len;
const guint8 *to_buf;
gboolean ret = FALSE;
g_autoptr(GFileEnumerator) dir_enum = NULL;
g_autoptr(GFile) deploydir = NULL;
- gs_unref_ptrarray GPtrArray *ret_deployments = NULL;
+ g_autoptr(GPtrArray) ret_deployments = NULL;
GError *temp_error = NULL;
deploydir = g_file_resolve_relative_path (self->path, "ostree/deploy");
gboolean ret = FALSE;
g_autoptr(GFileEnumerator) dir_enum = NULL;
g_autoptr(GFile) boot_ostree = NULL;
- gs_unref_ptrarray GPtrArray *ret_bootdirs = NULL;
+ g_autoptr(GPtrArray) ret_bootdirs = NULL;
GError *temp_error = NULL;
boot_ostree = g_file_resolve_relative_path (self->path, "boot/ostree");
guint i;
g_autoptr(GHashTable) active_deployment_dirs = NULL;
g_autoptr(GHashTable) active_boot_checksums = NULL;
- gs_unref_ptrarray GPtrArray *all_deployment_dirs = NULL;
- gs_unref_ptrarray GPtrArray *all_boot_dirs = NULL;
+ g_autoptr(GPtrArray) all_deployment_dirs = NULL;
+ g_autoptr(GPtrArray) all_boot_dirs = NULL;
if (stat ("/", &root_stbuf) != 0)
{
GError **error)
{
gboolean ret = FALSE;
- gs_unref_ptrarray GPtrArray *modified = NULL;
- gs_unref_ptrarray GPtrArray *removed = NULL;
- gs_unref_ptrarray GPtrArray *added = NULL;
+ g_autoptr(GPtrArray) modified = NULL;
+ g_autoptr(GPtrArray) removed = NULL;
+ g_autoptr(GPtrArray) added = NULL;
guint i;
int orig_etc_fd = -1;
int modified_etc_fd = -1;
GError **error)
{
gboolean ret = FALSE;
- gs_unref_ptrarray GPtrArray *path_parts = g_ptr_array_new ();
+ g_autoptr(GPtrArray) path_parts = g_ptr_array_new ();
g_autoptr(GFileInfo) root_info = NULL;
root_info = g_file_query_info (dir, OSTREE_GIO_FAST_QUERYINFO,
GError **error)
{
gboolean ret = FALSE;
- gs_unref_ptrarray GPtrArray *path_parts = g_ptr_array_new ();
+ g_autoptr(GPtrArray) path_parts = g_ptr_array_new ();
g_autoptr(GFileInfo) file_info = g_file_query_info (path, OSTREE_GIO_FAST_QUERYINFO,
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
cancellable, error);
guint i;
int new_deployserial = 0;
g_autoptr(GFile) osdir = NULL;
- gs_unref_ptrarray GPtrArray *tmp_current_deployments =
+ g_autoptr(GPtrArray) tmp_current_deployments =
g_ptr_array_new_with_free_func (g_object_unref);
osdir = ot_gfile_get_child_build_path (self->path, "ostree/deploy", osname, NULL);
{
gboolean ret = FALSE;
guint i;
- gs_unref_ptrarray GPtrArray *new_deployments = g_ptr_array_new_with_free_func (g_object_unref);
+ g_autoptr(GPtrArray) new_deployments = g_ptr_array_new_with_free_func (g_object_unref);
glnx_unref_object OstreeDeployment *new_deployment = NULL;
__attribute__((cleanup(_ostree_kernel_args_cleanup))) OstreeKernelArgs *kargs = NULL;
g_autofree char *new_options = NULL;
gboolean ret = FALSE;
int fd; /* Temporary owned by iterator */
g_autofree char *entries_path = g_strdup_printf ("boot/loader.%d/entries", bootversion);
- gs_unref_ptrarray GPtrArray *ret_loader_configs = NULL;
+ g_autoptr(GPtrArray) ret_loader_configs = NULL;
g_auto(GLnxDirFdIterator) dfd_iter = { 0, };
if (!ensure_sysroot_fd (self, error))
guint i;
int bootversion = 0;
int subbootversion = 0;
- gs_unref_ptrarray GPtrArray *boot_loader_configs = NULL;
- gs_unref_ptrarray GPtrArray *deployments = NULL;
+ g_autoptr(GPtrArray) boot_loader_configs = NULL;
+ g_autoptr(GPtrArray) deployments = NULL;
g_clear_pointer (&self->deployments, g_ptr_array_unref);
g_clear_pointer (&self->booted_deployment, g_object_unref);
gboolean ret = FALSE;
guint i;
OstreeDeployment *booted_deployment = NULL;
- gs_unref_ptrarray GPtrArray *deployments = NULL;
- gs_unref_ptrarray GPtrArray *new_deployments = g_ptr_array_new_with_free_func (g_object_unref);
+ g_autoptr(GPtrArray) deployments = NULL;
+ g_autoptr(GPtrArray) new_deployments = g_ptr_array_new_with_free_func (g_object_unref);
gboolean retain = (flags & OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN) > 0;
deployments = ostree_sysroot_get_deployments (sysroot);
va_list args;
const char *arg;
g_autofree char *path = NULL;
- gs_unref_ptrarray GPtrArray *components = NULL;
+ g_autoptr(GPtrArray) components = NULL;
va_start (args, first);
va_list args;
const char *arg;
g_autofree char *path = NULL;
- gs_unref_ptrarray GPtrArray *components = NULL;
+ g_autoptr(GPtrArray) components = NULL;
va_start (args, first);
{
gboolean ret = FALSE;
int i;
- gs_unref_ptrarray GPtrArray *ret_components = NULL;
+ g_autoptr(GPtrArray) ret_components = NULL;
if (strlen (path) > PATH_MAX)
{
glnx_unref_object OstreeSysroot *sysroot = NULL;
GKeyFile *origin = NULL;
glnx_unref_object OstreeRepo *repo = NULL;
- gs_unref_ptrarray GPtrArray *new_deployments = NULL;
+ g_autoptr(GPtrArray) new_deployments = NULL;
glnx_unref_object OstreeDeployment *new_deployment = NULL;
glnx_unref_object OstreeDeployment *merge_deployment = NULL;
g_autofree char *revision = NULL;
gboolean ret = FALSE;
glnx_unref_object OstreeDeployment *deployment = NULL;
g_autoptr(GFile) deployment_dir = NULL;
- gs_unref_ptrarray GPtrArray *modified = NULL;
- gs_unref_ptrarray GPtrArray *removed = NULL;
- gs_unref_ptrarray GPtrArray *added = NULL;
+ g_autoptr(GPtrArray) modified = NULL;
+ g_autoptr(GPtrArray) removed = NULL;
+ g_autoptr(GPtrArray) added = NULL;
g_autoptr(GFile) orig_etc_path = NULL;
g_autoptr(GFile) new_etc_path = NULL;
gboolean ret = FALSE;
glnx_unref_object OstreeRepo *repo = NULL;
OstreeDeployment *booted_deployment = NULL;
- gs_unref_ptrarray GPtrArray *deployments = NULL;
+ g_autoptr(GPtrArray) deployments = NULL;
guint i;
context = g_option_context_new ("List deployments");
glnx_unref_object OstreeSysroot *sysroot = NULL;
const char *deploy_index_str;
int deploy_index;
- gs_unref_ptrarray GPtrArray *current_deployments = NULL;
+ g_autoptr(GPtrArray) current_deployments = NULL;
glnx_unref_object OstreeDeployment *booted_deployment = NULL;
glnx_unref_object OstreeDeployment *target_deployment = NULL;
GError **error)
{
- gs_unref_ptrarray GPtrArray *current_deployments =
+ g_autoptr(GPtrArray) current_deployments =
ostree_sysroot_get_deployments (sysroot);
if (index < 0)
guint bootversion;
g_autoptr(GFile) subpath = NULL;
glnx_unref_object OstreeSePolicy *sepolicy = NULL;
- gs_unref_ptrarray GPtrArray *deployments = NULL;
+ g_autoptr(GPtrArray) deployments = NULL;
GOptionContext *context = NULL;
glnx_unref_object OstreeSysroot *sysroot = NULL;
g_autoptr(GFile) deployment_path = NULL;
GError **error)
{
gboolean ret = FALSE;
- gs_unref_ptrarray GPtrArray *path_parts = g_ptr_array_new ();
+ g_autoptr(GPtrArray) path_parts = g_ptr_array_new ();
g_autoptr(GFileInfo) root_info = NULL;
root_info = g_file_query_info (dir, OSTREE_GIO_FAST_QUERYINFO,
g_autoptr(GFile) subpath = NULL;
const char *prefix = NULL;
glnx_unref_object OstreeSePolicy *sepolicy = NULL;
- gs_unref_ptrarray GPtrArray *deployments = NULL;
+ g_autoptr(GPtrArray) deployments = NULL;
OstreeDeployment *first_deployment;
GOptionContext *context = NULL;
glnx_unref_object OstreeSysroot *sysroot = NULL;
{
gboolean ret = FALSE;
guint i;
- gs_unref_ptrarray GPtrArray *deployments = NULL;
+ g_autoptr(GPtrArray) deployments = NULL;
OstreeDeployment *first_deployment = NULL;
GOptionContext *context = NULL;
glnx_unref_object OstreeSysroot *sysroot = NULL;
g_autofree char *src_prev = NULL;
g_autoptr(GFile) srcf = NULL;
g_autoptr(GFile) targetf = NULL;
- gs_unref_ptrarray GPtrArray *modified = NULL;
- gs_unref_ptrarray GPtrArray *removed = NULL;
- gs_unref_ptrarray GPtrArray *added = NULL;
+ g_autoptr(GPtrArray) modified = NULL;
+ g_autoptr(GPtrArray) removed = NULL;
+ g_autoptr(GPtrArray) added = NULL;
context = g_option_context_new ("REV TARGETDIR - Compare directory TARGETDIR against revision REV");
g_option_context_add_main_entries (context, options, NULL);
GSConsole *console = NULL;
g_autofree char *src_repo_uri = NULL;
glnx_unref_object OstreeAsyncProgress *progress = NULL;
- gs_unref_ptrarray GPtrArray *refs_to_fetch = NULL;
+ g_autoptr(GPtrArray) refs_to_fetch = NULL;
g_autoptr(GHashTable) source_objects = NULL;
context = g_option_context_new ("SRC_REPO [REFS...] - Copy data from SRC_REPO");
g_autofree char *remote = NULL;
OstreeRepoPullFlags pullflags = 0;
GSConsole *console = NULL;
- gs_unref_ptrarray GPtrArray *refs_to_fetch = NULL;
+ g_autoptr(GPtrArray) refs_to_fetch = NULL;
glnx_unref_object OstreeAsyncProgress *progress = NULL;
gulong signal_handler_id = 0;
ot_static_delta_builtin_list (int argc, char **argv, GCancellable *cancellable, GError **error)
{
gboolean ret = FALSE;
- gs_unref_ptrarray GPtrArray *delta_names = NULL;
+ g_autoptr(GPtrArray) delta_names = NULL;
guint i;
GOptionContext *context;
glnx_unref_object OstreeRepo *repo = NULL;
if (opt_print_current_dir)
{
- gs_unref_ptrarray GPtrArray *deployments = NULL;
+ g_autoptr(GPtrArray) deployments = NULL;
OstreeDeployment *first_deployment;
g_autoptr(GFile) deployment_file = NULL;
g_autofree char *deployment_path = NULL;
{
glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new ();
glnx_unref_object OstreeMutableTree *parent = NULL;
- gs_unref_ptrarray GPtrArray *split_path = NULL;
+ g_autoptr(GPtrArray) split_path = NULL;
GError *error = NULL;
const char *pathname = "a/b/c/d/e/f/g/i";
const char *checksum = "01234567890123456789012345678901";
{
glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new ();
glnx_unref_object OstreeMutableTree *parent = NULL;
- gs_unref_ptrarray GPtrArray *split_path = NULL;
+ g_autoptr(GPtrArray) split_path = NULL;
GError *error = NULL;
const char *pathname = "/foo/bar/baz";
const char *checksum = "01234567890123456789012345678901";
{
glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new ();
glnx_unref_object OstreeMutableTree *parent = NULL;
- gs_unref_ptrarray GPtrArray *split_path = NULL;
+ g_autoptr(GPtrArray) split_path = NULL;
GError *error = NULL;
const char *dirname = "foo";
const char *filename = "bar";
{
glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new ();
glnx_unref_object OstreeMutableTree *parent = NULL;
- gs_unref_ptrarray GPtrArray *split_path = NULL;
+ g_autoptr(GPtrArray) split_path = NULL;
GError *error = NULL;
const char *filename = "bar";
const char *checksum = "01234567890123456789012345678901";
for (i = 0; paths[i]; i++)
{
GError *error = NULL;
- GPtrArray *components = NULL;
+ g_autoptr(GPtrArray) components = NULL;
if (! ot_util_path_split_validate (paths[i], &components, &error))
{
int j;
g_assert_null (strchr (components->pdata[i], '/'));
}
}
- gs_local_ptrarray_unref (components);
}
}